import Vue from 'vue';
import App from './App';
import store from './store/index';
import apiUrls from '@/common/api/url.js'
import language from '@/lang/index.js';
import {
	http
} from '@/common/api/index.js';
import {
	message,
	Router
} from '@/common/utils/index.js';
import {
	BASE_URL,
	IMG_BASE_URL,
	SYSTEM_CONFIG,
	PAGE_SIZE,
	VERSION_CODE,
	IS_DEV,
	needLoginPages,
	API_BASE_URL
} from '@/common/config.js';
import utils from '@/common/utils/utils';
// import VueI18n from 'vue-i18n';
import './common/filter/index.js';
import './common/mixin/index.js';

import {
	dianji,
	fabuChange
} from './common/utils/common.js'
Vue.prototype.$dianji = dianji;
Vue.prototype.$onoff = true;
const router = new Router({
	needLoginPages
});
// #ifdef APP-PLUS
import FuModal from '@/components/fu-modal/fu-modal.js';
Vue.use(FuModal);
// #endif

import uView from "uview-ui";
Vue.use(uView);


// Vue.use(VueI18n);
Vue.config.productionTip = false;
Vue.prototype.filterDictionary = function(id) {
	let item = global.dictionary.filter(item => item.id == id);
	if (item.length > 0) {
		return item[0].name;
	} else {
		return "未知";
	}
},

	// const i18n = new VueI18n({
	//   locale: uni.getStorageSync('language') || 'zh',
	//   messages: {
	//     en: language.en, // 英文
	//     zh: language.zh, // 中文
	//   },
	// });

Vue.prototype.$urouter = router;
Vue.prototype.$api = http;
Vue.prototype.$message = message;
Vue.prototype.$util = utils;
Vue.prototype.$store = store;
// Vue.prototype._i18n = i18n;

global.apiUrls = apiUrls;
global.imgBaseUrl = IMG_BASE_URL;
global.IS_DEV = IS_DEV;
global.PAGE_SIZE = PAGE_SIZE;
global.VERSION_CODE = VERSION_CODE;
global.SYSTEM_CONFIG = SYSTEM_CONFIG;
global.API_BASE_URL = API_BASE_URL;
global.token = '';
global.mainUserinfo = "";
global.chat = 1;
global.appointDate = '';
global.selectDate = '';
global.typeId = '';
global.dictionary = [];
global.category_id = "";
global.orderShop = "";
global.receipt_image = "";

App.mpType = 'app';

const app = new Vue({
	...App,
	store,

});

app.$mount();

global.$showModal = app.$showModal;